package hello.java.app2.appenum;

import java.util.HashMap;
import java.util.Map;

public enum CallRecordType {
    /// <summary>
    /// 普通通话
    /// </summary>
    Call(1),
    /// <summary>
    /// 队列通话
    /// </summary>
    Queue(2),
    /// <summary>
    /// 会议通话
    /// </summary>
    Conference(4),
    /// <summary>
    /// 广播通话
    /// </summary>
    Broadcast(8),
    /// <summary>
    /// 视频会议通话
    /// </summary>
    VideoConference(16),
    /// <summary>
    /// 录音通知通话
    /// </summary>
    RecordNotify(32),
    /// <summary>
    /// 语音会议通话记录
    /// </summary>
    VoiceConferenceRecord(64),
    /// <summary>
    /// 广播通话记录
    /// </summary>
    BroadcastRecord(128),
    /// <summary>
    /// 视频会议通话记录
    /// </summary>
    VideoConferenceRecord(256),
    /// <summary>
    /// 录音通知通话记录
    /// </summary>
    RecordNotifyRecord(512);

    private final int value;

    private CallRecordType(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    private static final Map<String, CallRecordType> map = new HashMap<>();

    static {
        for (CallRecordType type : CallRecordType.values()) {
            map.put(type.name(), type);
        }
    }

    public static CallRecordType fromString(String name) {
        return map.get(name);
    }
}